<script type="text/javascript">
    $("input[name='type']").click(function(){
            //var inputs = $(this).parents('dl').find('dt');
            var dl = $(this).parents('tr').next();//.find('dt');
            var nextdls = $("#nextdl").nextAll();
            
            if($(this).attr('checked')) {
                dl.find('td:eq(0)').html('<font color=red>链接地址：</font>');
                dl.find('span').hide();
                //var inputParent = $(this).parents('.app').find('p>input');    
                nextdls.hide();

            }else {
                dl.find('td:eq(0)').html('别名(拼音)：');
                dl.find('span').show();
                nextdls.show();
            }
            
        });
</script>
<div class="bjui-pageHeader">
    <div class="glyphicon glyphicon-th-large">修改栏目</div>
</div>
<div class="bjui-pageContent">
    <div class="form">
        <form method='post' data-toggle="validate" action="{:U('Category/edit')}">
             <table class="table table-bordered table-hover table-striped table-top" width="100%" height="100%">
            <tr>
                <td>所属栏目：</td>
                <td>
                    <select name="pid" data-toggle="selectpicker" data-width="200">
                        <option value="0">顶级栏目</option>
                        <foreach name='cate' item='v'>
                            <option value="{$v.id}" <if condition="$data.pid eq $v['id']">selected="selected"</if>
                            >{$v.delimiter}{$v.name}
                        </option>
                    </foreach>
                </select>
            </td>
        </tr>
        <tr>
            <td>内容模型：</td>
            <td>
                <select name="modelid" data-toggle="selectpicker" data-width="200">
                    <foreach name='mlist' item='v'>
                        <option value="{$v.id}" <if condition="$data.modelid eq $v['id']">selected="selected"</if>
                        >{$v.name}
                    </option>
                </foreach>
            </select>
        </td>
    </tr>
    <tr>
        <td>栏目名称：</td>
        <td>
            <input type="text" name="name" class="input-nm" value="{$data.name}"  data-rule="required" data-tip="请填写栏目名称" data-ok="OK" placeholder="栏目名称"/>
        </td>
    </tr>
    <tr>
        <td>栏目模板：</td>
        <td>
            <select name="template_list" data-toggle="selectpicker" data-width="200">
                <foreach name='styleListList' item='v'>
                    <option value="{$v}" <if condition="$data.template_list eq $v">selected="selected"</if>
                    >{$v}
                </option>
            </foreach>
        </select>
    </td>
</tr>
<tr>
    <td>内容页模板：</td>
    <td>
        <select name="template_show" data-toggle="selectpicker" data-width="200">
            <foreach name='styleShowList' item='v'>
                <option value="{$v}" <if condition="$data.template_show eq $v">selected="selected"</if>
                >{$v}
            </option>
        </foreach>
    </select>
</td>
</tr>

<tr>
<td>外部链接</td>
<td>
    <input type="checkbox" name="type" value="1" <if condition='$data.type eq 1'>checked="checked"</if>
/>外部链接
</td>
</tr>
<tr>
<td>别名(拼音)：</td>
<td>
<input type="text" name="ename" class="input-nm" value="{$data.ename}" />
<span>只能包含字母，数字</span>
</td>
</tr>
<tr>
<td>排序：</td>
<td>
<input type="text" name="sort" class="input-nm" value="{$data.sort}" data-rule="number" data-tip="请填排序" data-ok="OK" placeholder="排序"/>
</td>
</tr>
<tr>
<td>显示：</td>
<td>
<input data-toggle="icheck" data-label="显示" type="radio" name="status" value="1" <if condition='$data.status eq 1'>checked="checked"</if>
/>
<input data-toggle="icheck" data-label="隐藏" type="radio" name="status" value="0" <if condition='$data.status eq 0'>checked="checked"</if>
/> <font color="red">指隐藏和显示栏目及栏目内容出现在前台</font>
</td>
</tr>
<tr id="nextdl">
<td>导航显示：</td>
<td>
<input data-toggle="icheck" data-label="显示" type="radio" name="nav" value="1" <if condition='$data.nav eq 1'>checked="checked"</if>
/>
<input data-toggle="icheck" data-label="隐藏" type="radio" name="nav" value="0" <if condition='$data.nav eq 0'>checked="checked"</if>
/><font color="red">指是否显示在导航</font>
</td>
</tr>
<tr>
<td>Seo标题：</td>
<td>
<input type="text" name="seotitle" class="input-nm" value="{$data.seotitle}" />
</td>
</tr>
<tr>
<td>关键词：</td>
<td>
<input type="text" name="keywords" class="input-nm" value="{$data.keywords}" />
</td>
</tr>
<tr>
<td>栏目描述：</td>
<td>
<textarea name="description" class="tarea_default" rows="5" cols="30">{$data.description}</textarea>
</td>
</tr>

<input type="hidden" name="id" value="{$data.id}"/>
</table>
</form>
</div>
</div>
<div class="bjui-pageFooter">
<ul>
<li>
<button type="button" class="btn-close" data-icon="close">关闭</button>
</li>
<li>
<button data-icon="save" class="btn btn-default" type="submit">保存</button>
</li>
</ul>
</div>